import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
//一级路由
  {
    path: '/',
    redirect:'login',
  },
  {
    path:'/login',
    name:'login',
    component: () => import('../components/login/login.vue'),
    meta:{requireAuth:true}
  },
    //管理端
  {
    path: '/manage',
    name: 'manage',
    component: () => import('../components/Manage/manage.vue'),
    redirect: '/manage/file',
    children: [
      {
        path: '/manage/file',
        name: 'file',
        component: () => import('../components/File/file.vue')
      },
      {
        path: '/manage/regionFile',
        name: 'regionFile',
        component: () => import('../components/region/regionFile.vue')
      },
      {
        path: '/manage/question',
        name: 'question',
        component: () => import('../components/question/question.vue')
      }
    ],
  }

]

const router = new VueRouter({
  mode:'history',
  routes
})

export default router
